/**
 * Created by yuzhou on 2020/3/29.
 */
//获取
$(document).ready(function () {
    var app = new Vue({
        el: "#whole_box",
        data: {
            title:"",
            create_time:"",
            content:"",
            video_cn:true,
            video_en:false
        },
        mounted:function(){
            var self = this;
            var type_id = self.getQueryValue("id");

            $.ajax({
                type:"GET",
                url:"/infor/getIntroduce",
                data: {
                    id:type_id
                },
                dataType:"json",
                success:function(res){
                    var language = localStorage.getItem("language");
                    if(language == "cn"){
                        self.video_cn = true;
                        self.video_en = false;
                        self.video_url = "http://www.invcert.com/video/cn.mp4";
                        self.title = res.market_name;
                        self.content = res.introduce;
                    }else{
                        self.video_cn = false;
                        self.video_en = true;
                        self.video_url = "http://www.invcert.com/video/en.mp4";
                        self.title = res.market_name_en;
                        self.content = res.introduce_en;
                    }

                }
            });
        },
        methods: {
            getQueryValue:function (a) {
                var query = decodeURI(window.location.search.substring(1));
                var vars = query.split("&");
                for (var i = 0; i < vars.length; i++) {
                    var pair = vars[i].split("=");
                    if (pair[0] == a) { return pair[1]; }
                }
                return null;
            },

            getback:function () {
                window.history.back(-1);
            },


        },

    });
});